import React, { useContext } from 'react';
import { Button } from 'antd-mobile';
import { DesignContent } from './DesignContent';

function Buttons() {
  const { dispatch } = useContext(DesignContent);

  return (
    <div>
      <Button
        onClick={() => {
          dispatch({ color: 'red' });
        }}
      >
        红色
      </Button>
      <Button
        onClick={() => {
          dispatch({ color: 'yellow' });
        }}
      >
        黄色
      </Button>
    </div>
  );
}
export default Buttons;
